// -----------------------------------------------------------------------
//  <copyright file="ResourceOperationNode.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2025 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025-03-07 13:03</last-date>
// -----------------------------------------------------------------------

using DaprPlus.Authorization.Domain.Entities;


namespace DaprPlus.Authorization.Application.Queries;

[MapFrom(typeof(Resource))]
public class ResourceOperationNode
{
    public long Id { get; set; }

    public string? AllowedOperationsJson { private get; set; }

    public ResourceOperation[] AllowedOperations => string.IsNullOrEmpty(AllowedOperationsJson)
        ? []
        : AllowedOperationsJson!.FromTextJson<ResourceOperation[]>()!;
}
